package com.example.rtm.busline;

import okhttp3.FormBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.POST;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by RTM on 2017/9/25.
 */

public class buslineApi {
    public static Observable<Base> requestAliPay(String amount) {
        RequestBody body = new FormBody.Builder()
                .addEncoded("body", amount)
                .build();
        return NetworkRequest.buildRequest(Api.class)
                .request(body)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());
    }

    private interface Api {
        @POST("api/tool/insertbuslineinfo")
        Observable<Base> request(@Body RequestBody body);
    }
}
